home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE3 / PD / VICE / doc / vice_4 < prev    next >
Text File  |  2002-09-01  |  14KB  |  614 lines

  1. <HTML>
  2. <HEAD>
  3. <!-- This HTML file has been created by texi2html 1.52
  4.      from ../vice.texi on 31 August 2002 -->
  5.  
  6. <TITLE>VICE Manual - 4  System files</TITLE>
  7. </HEAD>
  8. <BODY>
  9. Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_3.html">previous</A>, <A HREF="vice_5.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
  10. <P><HR><P>
  11.  
  12.  
  13. <H1><A NAME="SEC23" HREF="vice_toc.html#TOC23">4  System files</A></H1>
  14.  
  15. <P>
  16. In order to work properly, the emulators need to load a few system
  17. files:
  18.  
  19. </P>
  20.  
  21. <UL>
  22.  
  23. <LI>
  24.  
  25. the <EM>system ROMs</EM>, raw binary files containing copies of the original ROMs
  26. of the machine you are emulating;
  27.  
  28. <LI>
  29.  
  30. the <EM>keyboard maps</EM>, text files describing the keyboard layout;
  31.  
  32. <LI>
  33.  
  34. the <EM>palette files</EM>, text files describing the colors of the machine you
  35. are emulating.
  36.  
  37. <LI>
  38.  
  39. the <EM>romset files</EM>, text files describing the different ROMs to load.
  40.  
  41. </UL>
  42.  
  43. <P>
  44. The place where they will be searched for depends on the value of the
  45. <CODE>Directory</CODE> resource, which is a colon (<CODE>:</CODE>)-separated search
  46. path list, like the UNIX <CODE>PATH</CODE> environment variable.  The
  47. default value is
  48.  
  49. </P>
  50.  
  51. <PRE>
  52. PREFIX/lib/vice/EMU:$HOME/.vice/EMU:BOOTPATH/EMU
  53. </PRE>
  54.  
  55. <P>
  56. Where <CODE>PREFIX</CODE> is the installation prefix (usually
  57. <TT>`/usr/local'</TT>), <CODE>EMU</CODE> is the name of the emulated machine
  58. (<CODE>C64</CODE>, <CODE>C128</CODE>, <CODE>PET</CODE>, <CODE>CBM-II</CODE> or <CODE>VIC20</CODE>) and
  59. <CODE>BOOTPATH</CODE> is the directory where the executable resides.
  60. The disk drive ROMs are looked for in a directory with <CODE>EMU</CODE> set to 
  61. <CODE>DRIVES</CODE>. <CODE>$HOME</CODE> is the user's home directory.
  62.  
  63. </P>
  64. <P>
  65. For example, if you have the C64 emulator installed in
  66.  
  67. </P>
  68.  
  69. <PRE>
  70. /usr/local/bin/x64
  71. </PRE>
  72.  
  73. <P>
  74. then the value will be
  75.  
  76. </P>
  77.  
  78. <PRE>
  79. /usr/local/lib/vice/C64:$HOME/.vice/C64:/usr/local/bin/C64
  80. </PRE>
  81.  
  82. <P>
  83. And system files will be searched for under the following directories,
  84. in the specified order:
  85.  
  86. </P>
  87.  
  88. <OL>
  89. <LI>
  90.  
  91. <CODE>/usr/local/lib/VICE/C64</CODE>
  92. <LI>
  93.  
  94. <CODE>$HOME/.vice/C64</CODE>
  95. <LI>
  96.  
  97. <CODE>/usr/local/bin/C64</CODE>
  98. </OL>
  99.  
  100. <P>
  101. System files can still be installed in a different directory if you
  102. specify a complete path instead of just a file name.  For example, if
  103. you specify <TT>`./kernal'</TT> as the kernal image name, the kernal image
  104. will be loaded from the current directory.  This can be done by using
  105. command-line options or by modifying resource values (see section <A HREF="vice_6.html#SEC40">6.1  Format of resource files</A>).
  106.  
  107. </P>
  108.  
  109.  
  110.  
  111. <H2><A NAME="SEC24" HREF="vice_toc.html#TOC24">4.1  ROM files</A></H2>
  112.  
  113. <P>
  114. Every emulator requires its own ROM set.  For the VIC20 and the C64, the
  115. ROM set consists of the following files:
  116.  
  117. </P>
  118.  
  119. <UL>
  120.  
  121. <LI>
  122.  
  123. <TT>`kernal'</TT>,  the Kernal ROM (8 KBytes)
  124.  
  125. <LI>
  126.  
  127. <TT>`basic'</TT>, the Basic ROM (8 KBytes)
  128.  
  129. <LI>
  130.  
  131. <TT>`chargen'</TT>, the character generator ROM (4 Kbytes)
  132.  
  133. </UL>
  134.  
  135. <P>
  136. The C128 needs the following files:
  137.  
  138. </P>
  139.  
  140. <UL>
  141.  
  142. <LI>
  143.  
  144. <TT>`kernal'</TT>, the Kernal ROM (8 Kbytes)
  145.  
  146. <LI>
  147.  
  148. <TT>`basic'</TT>, the Basic + Editor ROM (32 Kbytes)
  149.  
  150. <LI>
  151.  
  152. <TT>`chargen'</TT>, the character generator ROM (4 Kbytes)
  153.  
  154. </UL>
  155.  
  156. <P>
  157. The C128, VIC20 and C64 emulators also need the following DOS ROMs for
  158. the hardware-level emulation of the 1541, 1571 and 1581 disk drives:
  159.  
  160. </P>
  161.  
  162. <UL>
  163.  
  164. <LI>
  165.  
  166. <TT>`dos1541'</TT>, the 1541 drive ROM (16 Kbytes)
  167.  
  168. <LI>
  169.  
  170. <TT>`dos1541II'</TT>, the 1541-II drive ROM (16 Kbytes)
  171.  
  172. <LI>
  173.  
  174. <TT>`dos1571'</TT>, the 1571 drive ROM (32 Kbytes)
  175.  
  176. <LI>
  177.  
  178. <TT>`dos1581'</TT>, the 1581 drive ROM (32 Kbytes)
  179.  
  180. </UL>
  181.  
  182. <P>
  183. In addition to those all emulators can handle 
  184. a parallel IEEE488 interface (the C64 and C128 via <CODE>$df**</CODE> extension,
  185. the VIC20 via VIC1112 emulation)
  186. so they also need the DOS ROM for the IEEE disk drives:
  187.  
  188. </P>
  189.  
  190. <UL>
  191.  
  192. <LI>
  193.  
  194. <TT>`dos2031'</TT>, the 2031 drive ROM (16 Kbytes)
  195. (DOS 2.6, Commodore ROM images 901484-03 and 901484-05)
  196.  
  197. <LI>
  198.  
  199. <TT>`dos2040'</TT>, the 2040 drive ROM (8 Kbytes)
  200. (DOS 1, Commodore ROM images 901468-06, 901468-07)
  201.  
  202. <LI>
  203.  
  204. <TT>`dos3040'</TT>, the 3040 drive ROM (12 Kbytes)
  205. (DOS 2, Commodore ROM images 901468-11, 901468-12 and 901468-13)
  206.  
  207. <LI>
  208.  
  209. <TT>`dos4040'</TT>, the 4040 drive ROM (12 Kbytes)
  210. (DOS 2, Commodore ROM images 901468-14, 901468-15 and 901468-16)
  211.  
  212. <LI>
  213.  
  214. <TT>`dos1001'</TT>, the 1001/8050/8250 drive ROM (16 Kbytes)
  215. (DOS 2.7, Commodore ROM images 901887-01 and 901888-01)
  216.  
  217. </UL>
  218.  
  219. <P>
  220. Note that there are other DOS images on the internet. The DOS 2.5 images
  221. might be used with the 8050, but it cannot handle the double sided drives
  222. of the 1001 and 8250 and it is not supported by VICE.
  223.  
  224. </P>
  225. <P>
  226. The PET emulator uses an expanded setup, because there are three major 
  227. versions of the Basic and the Kernal, and many versions of the 
  228. Editor ROM. In addition there are cartridge ROM sockets.
  229.  
  230. </P>
  231. <P>
  232. The Kernal files contain the memory from range $F000-$FFFF, the Basic
  233. ROMs either the range $C000-$DFFF or $B000-$DFFF.
  234. To handle the different screen
  235. sizes and keyboards, different so-called "editor-ROMs" for the memory
  236. range $E000-$E800 are provided. 
  237. The PET ROMs have the following names:
  238.  
  239. </P>
  240.  
  241. <UL>
  242.  
  243. <LI>
  244.  
  245. <TT>`kernal1'</TT>, the PET2001 Kernal ROM (4 KBytes)
  246. (Commodore ROM images 901447-06 and 901447-07)
  247. <LI>
  248.  
  249. <TT>`kernal2'</TT>, the PET3032 Kernal ROM (4 KBytes)
  250. (Commodore ROM image 901465-03)
  251. <LI>
  252.  
  253. <TT>`kernal4'</TT>, the PET4032/8032 Kernal ROM (4 KBytes)
  254. (Commodore ROM image 901465-22)
  255.  
  256. <LI>
  257.  
  258. <TT>`basic1'</TT>, the PET2001 Basic 1 ROM (8 KBytes)
  259. (Commodore ROM images 901447-09, 901447-02, 901447-03, 901447-04.bin.
  260. The -09 ROM is the revised -01 ROM)
  261. <LI>
  262.  
  263. <TT>`basic2'</TT>, the PET3032 Basic 2 ROM (8 KBytes)
  264. (Commodore ROM images 901465-01 and 901465-01)
  265. <LI>
  266.  
  267. <TT>`basic4'</TT>, the PET4032/8032 Basic 4 ROM (12 KBytes)
  268. (Commodore ROM images 901465-23, 901465-20 and 901465-21. 
  269. The -23 ROM is a revised -19 ROM)
  270.  
  271. <LI>
  272.  
  273. <TT>`edit1g'</TT>, the PET2001 editor for graphics keyboards (2 KBytes)
  274. (Commodore ROM image 901447-05)
  275. <LI>
  276.  
  277. <TT>`edit2b'</TT>, the PET3032 editor for business keyboards (2 KBytes)
  278. (Commodore ROM image 901474-01)
  279. <LI>
  280.  
  281. <TT>`edit2g'</TT>, the PET3032 editor for graphics keyboards (2 KBytes)
  282. (Commodore ROM image 901447-24)
  283. <LI>
  284.  
  285. <TT>`edit4g40'</TT>, the PET4032 editor for graphics keyboards (2 KBytes)
  286. (Commodore ROM image 901498-01)
  287. <LI>
  288.  
  289. <TT>`edit4b40'</TT>, the PET4032 editor for business keyboards (2 KBytes)
  290. (Commodore ROM image 901474-02)
  291. <LI>
  292.  
  293. <TT>`edit4b80'</TT>, the PET8032 editor for business keyboards (2 KBytes)
  294. (Commodore ROM image 901474-04-?)
  295. <LI>
  296.  
  297. <LI>
  298.  
  299. <TT>`chargen'</TT>, the character generator ROM (2k).  It has two sets
  300. with 128 chars each.  The second (inverted) half of each set is computed from
  301. the first half by inverting it.  This is a PET hardware feature.
  302. (Commodore ROM image 901447-10)
  303. <LI>
  304.  
  305. <TT>`chargen.de'</TT>, the character generator ROM (2k). This version is a 
  306. patched German charset, with the characters [, \ and ] replaced by umlauts.
  307. It has been provided by U. Guettich and he reports that it is supported
  308. by some programs.
  309. </UL>
  310.  
  311. <P>
  312. The PETs also have sockets for extension ROMs for the addresses
  313. $9000-$9FFF, $A000-$AFFF and $B000-$BFFF (the last one for PET2001 and
  314. PET3032 only).  You can specify ROM image files for those extensions
  315. command line options <CODE>-petrom9</CODE>, <CODE>-petromA</CODE> and
  316. <CODE>-petromB</CODE> resp.
  317.  
  318. </P>
  319. <P>
  320. An alternative would be to specify a long kernal ROM with the
  321. <CODE>-kernal</CODE> option that includes the extension ROM areas.
  322.  
  323. </P>
  324. <P>
  325. Also, you can specify replacements for the basic ROM at $B000-$DFFF
  326. with the <CODE>-petromBasic</CODE> option and for the editor ROM
  327. at $E000-$E7FF with the <CODE>-petromEditor</CODE> option.
  328.  
  329. </P>
  330. <P>
  331. The CBM-II emulator again uses another setup.  For those models the
  332. kernal used is the same for all.  However, for different amounts of
  333. memory exist different versions of the BASIC ROMs.  The 128k RAM version
  334. (C610, C710, B128) uses one bank of 64k for the BASIC text and another
  335. one for all the variables.  The 256k RAM version uses one bank for text,
  336. one for variables, one for arrays and one for strings.
  337.  
  338. </P>
  339. <P>
  340. Also the character generator ROMs have a format different from the
  341. above.  The other character ROMs have 8 bytes of pixel data per
  342. character.  Those ROMs have 16 bytes per character instead.  The C6x0
  343. only uses the first 8 of it, but the C7x0 uses 14 lines per character
  344. and needs those increased ROMs.  Both ROMs hold, like the PET, two
  345. character sets with 128 characters each.  Again the second half of the
  346. full (256 char) character set is computed by inverting.
  347.  
  348. </P>
  349.  
  350. <UL>
  351.  
  352. <LI>
  353.  
  354. <TT>`kernal'</TT>, the KERNAL (8k) for the business machines (6xx/7xx)
  355.  
  356. <LI>
  357.  
  358. <TT>`kernal.500'</TT>, the KERNAL (8k) for the personal machine (510) (901234-02)
  359.  
  360. <LI>
  361.  
  362. <TT>`basic.128'</TT>, the CBM-II 128k BASIC (16k)
  363.  
  364. <LI>
  365.  
  366. <TT>`basic.256'</TT>, CBM-II 256k BASIC (16k)
  367.  
  368. <LI>
  369.  
  370. <TT>`basic.500'</TT>, C510 BASIC (16k) (901236-02 + 901235-02)
  371.  
  372. <LI>
  373.  
  374. <TT>`chargen.500'</TT>, character generator ROM for the C5x0 (4k) (901225-01)
  375.  
  376. <LI>
  377.  
  378. <TT>`chargen.600'</TT>, character generator ROM for the C6x0 (4k)
  379.  
  380. <LI>
  381.  
  382. <TT>`chargen.700'</TT>, character generator ROM for the C7x0 (4k)
  383.  
  384. </UL>
  385.  
  386.  
  387.  
  388. <H2><A NAME="SEC25" HREF="vice_toc.html#TOC25">4.2  Keymap files</A></H2>
  389.  
  390. <P>
  391. <EM>Keymap files</EM> are used to define the keyboard layout, defining which
  392. key (or combination of keys) must be mapped to each keysym.
  393.  
  394. </P>
  395. <P>
  396. In other words, the keyboard emulation works like this: whenever the
  397. user presses or releases a key while the emulation window has the input
  398. focus, the emulator receives an X-Window event with a value that
  399. identifies that key.  That value is called a <EM>keysym</EM> and is unique
  400. to that key.  The emulator then looks up that keysym in an internal
  401. table that tells it which key(s) to press or release on the emulated
  402. keyboard.
  403.  
  404. </P>
  405. <P>
  406. This table is described by the keymap file, which is made up of lines
  407. like the following:
  408.  
  409. </P>
  410.  
  411. <PRE>
  412. KEYSYM ROW COLUMN SHIFTFLAG
  413. </PRE>
  414.  
  415. <P>
  416. Where:
  417.  
  418. </P>
  419.  
  420. <UL>
  421.  
  422. <LI>
  423.  
  424. <CODE>KEYSYM</CODE> is a string identifying the keysym: you can use the
  425. <CODE>xev</CODE> utility (shipped with the X Window system) to see what keysym
  426. is bound to any key;
  427.  
  428. <LI>
  429.  
  430. <CODE>ROW</CODE> and <CODE>COLUMN</CODE> identify the key on the emulated keyboard;
  431.  
  432. <LI>
  433.  
  434. <CODE>SHIFTFLAG</CODE> can have one of the following values:
  435.  
  436.  
  437. <UL>
  438.  
  439. <LI>
  440.  
  441. <CODE>0</CODE>: the key is never shifted;
  442.  
  443. <LI>
  444.  
  445. <CODE>1</CODE>: the key is shifted;
  446.  
  447. <LI>
  448.  
  449. <CODE>2</CODE>: the key is the left shift;
  450.  
  451. <LI>
  452.  
  453. <CODE>4</CODE>: the key is the right shift;
  454.  
  455. <LI>
  456.  
  457. <CODE>8</CODE>: the key can be (optionally) shifted by the user.
  458.  
  459. </UL>
  460.  
  461. </UL>
  462.  
  463. <P>
  464. The <CODE>SHIFTFLAG</CODE> is useful if you want certain keys to be
  465. "artificially" shifted by the emulator, and not by the user.  For
  466. example, <KBD>F2</KBD> is shifted on the C64 keyboard, but you might want it
  467. to be mapped to the unshifted <KBD>F2</KBD> key on the PC keyboard.  To do
  468. so, you just have to use a line like the following:
  469.  
  470. </P>
  471.  
  472. <PRE>
  473. F2 0 4 1
  474. </PRE>
  475.  
  476. <P>
  477. where <CODE>0</CODE> and <CODE>4</CODE> identify the key (row 0, column 4 on the
  478. keyboard matrix), and <CODE>1</CODE> specifies that every time the user presses
  479. <KBD>F2</KBD> the shift key on the C64 keyboard must be pressed.
  480.  
  481. </P>
  482. <P>
  483. There are also some special commands you can put into the keyboard file;
  484. they are recognized because they start with an exclamation mark:
  485.  
  486. </P>
  487.  
  488. <UL>
  489.  
  490. <LI>
  491.  
  492. <CODE>!CLEAR</CODE> clears the currently loaded keyboard map; it is
  493. necessary to put this at the beginning of the file if you want the
  494. keymap file to override all of the current internal settings;
  495.  
  496. <LI>
  497.  
  498. <CODE>!LSHIFT</CODE>, <CODE>!RSHIFT</CODE>, followed by a row and a column
  499. value, specify where the left and right shift keys are located on the
  500. emulated keyboard; for example, C64 default keymaps will specify
  501.  
  502.  
  503. <PRE>
  504. !LSHIFT 1 7
  505. !RSHIFT 6 4
  506. </PRE>
  507.  
  508. </UL>
  509.  
  510. <P>
  511. Any line starting with the <CODE>#</CODE> sign, instead, is completely
  512. ignored.  This is useful for adding comments within the keymap file.
  513.  
  514. </P>
  515. <P>
  516. VICE keymap files have the <TT>`.vkm'</TT> default extension, and every
  517. emulator comes with a default positional mapping and a default symbolic
  518. mapping.
  519.  
  520. </P>
  521.  
  522.  
  523.  
  524. <H2><A NAME="SEC26" HREF="vice_toc.html#TOC26">4.3  Palette files</A></H2>
  525.  
  526. <P>
  527. <EM>Palette files</EM> are used to specify the colors used in the
  528. emulators.  They are made up of lines like the following:
  529.  
  530. </P>
  531.  
  532. <PRE>
  533. RED GREEN BLUE DITHER
  534. </PRE>
  535.  
  536. <P>
  537. where <CODE>RED</CODE>, <CODE>GREEN</CODE> and <CODE>BLUE</CODE> are hexadecimal values
  538. ranging from 0 to FF and specifying the amount of red, green and blue
  539. you want for each color and <CODE>DITHER</CODE> is a 4-bit hexadecimal number
  540. specifying the pattern you want when rendering on a B/W display.
  541.  
  542. </P>
  543. <P>
  544. You have to include as many lines as the number of colors the emulated
  545. machine has, and the order of the lines must respect the one used in the
  546. machine (so the N'th line must contain the specifications for color N -
  547. 1 in the emulated machine).
  548.  
  549. </P>
  550. <P>
  551. Lines starting with the <CODE>#</CODE> sign are completely ignored.  This is
  552. useful for adding comments (such as color names) within the palette
  553. file.
  554.  
  555. </P>
  556. <P>
  557. For example, the default PET palette file (which has only two colors, 0 for
  558. background and 1 for foreground), looks like the following:
  559.  
  560. </P>
  561.  
  562. <PRE>
  563. #
  564. # VICE Palette file
  565. #
  566. # Syntax:
  567. # Red Green Blue Dither
  568. #
  569.  
  570. # Background
  571. 00 00 00 0
  572.  
  573. # Foreground
  574. 00 FF 00 F
  575. </PRE>
  576.  
  577.  
  578.  
  579. <H2><A NAME="SEC27" HREF="vice_toc.html#TOC27">4.4  Romset files</A></H2>
  580.  
  581. <P>
  582. The Romset files are not used by default on all emulators. 
  583. You might have recognized that the names of the ROM images are 
  584. saved in resources. Loading a Romset file now just means a `shortcut'
  585. to changing all the resources with ROM image names and reloading
  586. the ROMs. 
  587.  
  588. </P>
  589. <P>
  590. The PET and CBM-II emulators use this feature to change between the
  591. different ROM versions available for those machines. E.g. the 
  592. Romset file for the PET 2001 is
  593.  
  594. </P>
  595.  
  596. <PRE>
  597. KernalName="pet2001"
  598. EditorName=
  599. ChargenName="chargen"
  600. RomModule9Name=
  601. RomModuleAName=
  602. RomModuleBName=
  603. </PRE>
  604.  
  605. <P>
  606. As you can see, the file even uses the same syntax as the 
  607. resource file, it is just a bit stripped down.
  608.  
  609. </P>
  610. <P><HR><P>
  611. Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_3.html">previous</A>, <A HREF="vice_5.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
  612. </BODY>
  613. </HTML>
  614.